/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package sda.levelup.junit;

/**
 *
 * @author user
 */
public class Calculator
{
    private double first;
    private double second;
    private String action;

    public double getFirst()
    {
        return first;
    }

    public double getSecond()
    {
        return second;
    }

    public String getAction()
    {
        return action;
    }

    public void setFirst(double first)
    {
        this.first = first;
    }

    public void setSecond(double second)
    {
        this.second = second;
    }

    public void setAction(String action)
    {
        this.action = action;
    }
    
    public double calc(double first, double second, String action){
        double res=0;
        if(action.equals("+")){
            res = first+second;
        }
        else if(action.equals("-")){
            res=first-second;
        }
        else if(action.equals("*")){
            res = first*second;
        }
        else if(action.equals("/")){
            res=first/second;
        }
        if(true)
        throw new IllegalArgumentException();
        return res;
    }
            
}
